package org.mqlink4sap.configuration;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.yaml.snakeyaml.Yaml;

public class Configuration {
	
	public Map<String, Properties> Systems = new HashMap<>();
	public List<LinkDefinition> Links;
	
	public static Configuration load(String fileName)
			throws FileNotFoundException {
		return new Yaml().loadAs(new FileInputStream(fileName),
				Configuration.class);
	}
	
	@Override
	public String toString() {
		return new StringBuilder()
			.append("---- Systems ----")
			.append(Systems.toString())
			.append("---- Links ----")
			.append(Links.toString())
			.toString();
	}

}
